package yunjiao.javatutorials.designpatterns.visitor.example1.items;

import lombok.Data;

/**
 * TODO
 *
 * @author yangyunjiao
 */
@Data
public class Vegetable  implements ShopItem {
    private String name;
    private double pricePerKg;
    private double weight;

    public Vegetable(String name, double pricePerKg, double weight) {
        this.name = name;
        this.pricePerKg = pricePerKg;
        this.weight = weight;
    }

    @Override
    public double getPrice() {
        return getPricePerKg();
    }

    @Override
    public ShopItemCategory getCategory() {
        return ShopItemCategory.VEGETABLE;
    }

    @Override
    public String toString() {
        return "Vegetable [name=" + name +
                ", pricePerKg=" + pricePerKg +
                ", weight=" + weight +
                "]";
    }


}
